home *** CD-ROM | disk | FTP | other *** search
/ Apple II Magazines (PO) / Nibble Volume 09, No. 07 (1988-07)(MicroSPARC)(Side A).zip / Nibble Volume 09, No. 07 (1988-07)(MicroSPARC)(Side A).po / NR.CONVERTER.S < prev    next >
Text File  |  1996-12-24  |  4KB  |  136 lines

  1.                          ;******************************
  2.                          ; *                          *
  3.                          ;  *        NR.POKE         *
  4.                          ;   *  by Sherman Paddock  *
  5.                          ;    > CopyRight (c) 1987 <
  6.                          ;   *  by MicroSPARC, Inc  *
  7.                          ;  *   Concord, MA  01742   *
  8.                          ; *                          *
  9.                          ;******************************
  10.                          ; *                          *
  11.                          ;  >The MicroSPARC ASSEMBLER<
  12.                          ; *                          *
  13.                          ;******************************
  14.                          ;
  15.                          ;
  16.                          ; NOTE:  This is already in the
  17.                          ;      AppleSoft program and does
  18.                          ;      not need to be keyed in
  19.                          ;
  20.                          ;
  21. ARYTAB    EQU $6B
  22. ARYSAVE   EQU $FC
  23. NRADRS    EQU $FE
  24. COUNTER   EQU $4000      ;#16384
  25. *
  26.           ORG $0300      ;#768
  27. *
  28.           LDA #$40
  29.           STA NRADRS+1   ;Initialize NewsRoom data
  30.           LDY #$00       ; address to $4000
  31.           STY NRADRS
  32.           STY COUNTER+1
  33. *
  34.           INY
  35.           STY COUNTER    ;Initialize byte counter to one
  36. *
  37.           INY
  38.           LDX #0
  39. ESTABHD   LDA HEADER,X
  40.           STA (NRADRS),Y ;Establish NewsRoom header
  41.           INY
  42.           INX
  43.           CPX #5
  44.           BCC ESTABHD
  45. *
  46.           STY NRADRS     ;Now established as $4007
  47. *
  48.           CLC
  49.           LDA ARYTAB
  50.           PHA            ;Save original pointer
  51.           ADC #7         ; then add 7 to it
  52.           STA ARYTAB
  53.           STA ARYSAVE    ;  and save for later
  54.           LDA ARYTAB+1
  55.           PHA
  56.           ADC #0
  57.           STA ARYTAB+1
  58.           STA ARYSAVE+1
  59. *
  60. GETLEN    LDY #0
  61.           LDA (ARYTAB),Y ;Get length of each record
  62.           BEQ LASTRECD   ;if there are no more records
  63. *
  64.           TAX            ;Save length in 'X'
  65.           INC ARYTAB
  66.           BNE SAVEPTR
  67. *
  68.           INC ARYTAB+1
  69. SAVEPTR   LDA ARYTAB+1
  70.           PHA            ;Save record adrs pointer to Stack
  71.           LDA ARYTAB
  72.           PHA
  73. *
  74.           LDA (ARYTAB),Y
  75.           PHA            ;Temp save low-byte of record adrs
  76.           INY
  77.           LDA (ARYTAB),Y
  78.           STA ARYTAB+1
  79.           PLA            ;Retreive low-byte
  80.           STA ARYTAB     ;now points to record
  81.           DEY
  82. *
  83. INCRCNTR  INC COUNTER    ;Count each byte processed
  84.           BNE MVRECORD
  85.           INC COUNTER+1
  86. *
  87. MVRECORD  LDA (ARYTAB),Y ;Move record
  88.           STA (NRADRS),Y ; to new area
  89.           INY
  90.           DEX
  91.           BNE INCRCNTR   ;  until 'X' equals zero
  92. *
  93.           TYA
  94.           CLC
  95.           ADC NRADRS
  96.           STA NRADRS     ;Update address
  97.           LDA #0
  98.           ADC NRADRS+1
  99.           STA NRADRS+1
  100. *
  101.           CLC
  102.           PLA            ;Retreive record adrs pointer
  103.           ADC #2         ; from Stack, then add two to
  104.           STA ARYTAB     ;  point to next record's length
  105.           PLA
  106.           ADC #0
  107.           STA ARYTAB+1
  108.           BNE GETLEN     ;(always branches)
  109. *
  110. LASTRECD  LDA #127
  111.           STA (NRADRS),Y ;Insert NewsRoom ending flag
  112. *
  113.           LDA #69
  114.           ADC ARYSAVE    ;Find 24th record
  115.           STA NRADRS
  116.           LDA #0
  117.           ADC ARYSAVE+1
  118.           STA NRADRS+1
  119. *
  120. MVARRAY   LDA (NRADRS),Y ;Move all records
  121.           STA (ARYSAVE),Y; up 24
  122.           INY
  123.           CPY #234
  124.           BCC MVARRAY
  125. *
  126.           PLA            ;Return original pointer
  127.           STA ARYTAB+1
  128.           PLA
  129.           STA ARYTAB
  130. *
  131.           RTS
  132. *
  133. *****
  134. *
  135. HEADER    DFC $00,$01,$54,$73,$00
  136.